<template>
	<div>
		<!--我的资料-->
		<div style="width: 100%;height: 180px;background-color: #30383F;">
			<div style="margin: 0 auto;width: 70px;text-align: center;padding-top: 50px;">
				<div>
					<i style="font-size: 50px;color: white;" class="alicon icon-wode"></i>
				</div>
				<div style="color: white;" id="usn" >{{userName}}</div >
				<div style="color: #FFFFFF;font-size: 12px;"></div >
			</div>
		</div>
		<div class="mui-content">
		   
		        <ul class="mui-table-view">
		            <li class="mui-table-view-cell">姓名 <span class="mui-badge">{{userName}}</span></li>
		            <li class="mui-table-view-cell" v-if="classe==''?false:true">班级<span class="mui-badge" >{{classe}}</span></li>
		            <li class="mui-table-view-cell" v-if="studentno==''?false:true">学号<span class="mui-badge">{{studentno}}</span></li>
		            <li class="mui-table-view-cell" v-if="teacherno==''?false:true">工号<span class="mui-badge">{{teacherno}}</span></li>
		        </ul>
		</div>
	</div>
</template>

<script>
	import { Toast } from 'mint-ui';
	import { mapState } from 'vuex'
	import axios from 'axios'
	import api from "@/components/js/Apidomain.js"
	import { setlocalstorage,setsessionstorage,removesessionstorage,removelocalstorage } from "@/components/js/Localstorage.js"
	export default{
		
		data(){
			return{
				Role:'',
				roleId:'',
				userName:'',
				classe:'',
				studentno:'',
				teacherno:''
			}
		},
		mounted()
            {
          		this.init();   //页面初始化加载
        	},
            methods:
            {
            	init()
					{	
						
						

					var self = this;
					this.Role=sessionStorage.getItem('role');
//					console.log(Role);
            		this.roleId= sessionStorage.getItem('roleid');
            		this.userName= sessionStorage.getItem('username');
					
            		let url = api.apidomain+'/tqes/web/sysUser/getSystemUserMyInfo';
            		this.$http.post(url,{"roleid":this.roleId,}).then(function(response) {
						if(response.data.success == true){
							console.log(response.data.data)
//							setsessionstorage('serialno',response.data.data.studentNo);
//							setsessionstorage('classEs',response.data.data.classes);
							
							self.classe= response.data.data.classes;
							self.studentno=response.data.data.studentNo;
							self.teacherno=response.data.data.teacherNo;
							console.log(response.data.data.classes)
							console.log(response.data.data.studentNo)
		            }else if(response.data.success == false){
							Toast({
									message: response.data.msg,
									position: 'middle',
									duration: 1000
								});  
		            		
		            	}
		            	
					})
					.catch(function(error) {
						Toast({
									message: "系统发生错误",
									position: 'middle',
									duration: 1000
								});  
					});
				
			}	
		}
            }
	
	
					
	 
</script>

<style scoped>
	.mui-badge{
		background-color: rgba(0, 0, 0, 0) !important;
		font-size: 14px;
		color: #888888;
	}
</style>